package com.tencent.sr.iris.activity.domain.event.dto;

import com.alibaba.fastjson.JSONObject;
import java.util.Date;
import lombok.Data;

@Data
public class ActivityTaskDTO {

    private Long id;
    private String bizId;
    private String activityId;
    private String name;
    private String conditionRule;
    private String conditionThreshold;
    private Date startTime;
    private Date endTime;

    private String taskType;

    //权益id
    private String awardInfo;
    //权益id+权益信息
    private String awardType;
    private byte status;

    //佣金上限
    private Integer commissionLimit;
    //分享次数上线
    private Integer shareTimeLimit;
    //gmv
    private Integer gmv;

    //任务阶梯
    private Integer tier;

    public void parseLimitCondition() {
        JSONObject object = JSONObject.parseObject(conditionThreshold);
        this.commissionLimit = object.getInteger("targetCommission");
        this.shareTimeLimit = object.getInteger("targetShare");
        this.gmv = object.getInteger("gmv");
    }


}
